import json
from django.db.models import Q, F
from apps.merchant.item.dao import ItemBaseSerializer, ItemDao
from apps.merchant.sku.dao import SkuBaseSerializer, SkuDao


def buyItemHandle(order):
    content = json.loads(order.content)
    print('content', content)
    for item in content:
        if item.get('sku'):
            # 销量加一
            SkuDao().addSales(item.get('sku'), item.get('payCount'))
            ItemDao().addSales(item.get('item'), item.get('payCount'))
